﻿<script type="text/javascript">
    jQuery(document).ready(function() {
        jQuery('@ID("#txt_avatarFile")').autocomplete({
            source: function (request, response) {
                jQuery.post('@Html.Raw(Url.Action(Loc.Act("Autocomplete").Ctrl("File").Area("Wizard")))', request, response);
            },
            minLength: 3,
            select: function (event, ui) {
                jQuery('@ID("#hidden_avatarFile")').val(ui.item.id);
            }
        });
    });
</script>
<form class="common-form" id="@ID("form")" action="@Url.Action(Loc.Act("Prof").Localized())" method="post">
    <table>
        <tr>
            <td>
                <label>@T(Res.Name("FullName"))</label>
            </td>
            <td>
                <input type="text" name="fullName" value="@Svc.Attribute(Par.In("WebPortal").Of("Profile").Name("FullName"))" maxlength="1000" />
            </td>
        </tr>
        <tr>
            <td>
                <label>@T(Res.Name("ShortBio"))</label>
            </td>
            <td>
                <textarea name="shortBio" maxlength="1000">@Svc.Attribute(Par.In("WebPortal").Of("Profile").Name("ShortBio"))</textarea>
            </td>
        </tr>
        <tr>
            <td>
                <label>@T(Res.Name("AvatarFile"))</label>
            </td>
            <td>
                <input id="@ID("hidden_avatarFile")" type="hidden" name="avatarFileID" 
                    value="@(Svc.ForumMember.AvatarFile != null 
                        ? JDM.Int32(Svc.ForumMember.AvatarFile.EntityID) 
                        : 0)" />
                <input id="@ID("txt_avatarFile")" type="text" name="avatarFileName" 
                    value="@(Svc.ForumMember.AvatarFile != null 
                        ? JDM.String(Svc.ForumMember.AvatarFile.Name) 
                        : String.Empty)" />
            </td>
        </tr>
        <tr>
            <td>
                <label>@T(Res.Name("Signature"))</label>
            </td>
            <td>
                <textarea name="forumSignature" maxlength="1000">@JDM.String(Svc.ForumMember.Signature)</textarea>
            </td>
        </tr>
    </table>
    <ul class="bar toolbar">
        <li><input class="button" type="submit" value="@T(Res.In("Common").Of("Act").Name("Submit"))" /></li>
    </ul>
</form>